<template>
	<view class="main-page" style="background: white;align-items: center;">
		<image class="icon" src="../../static/mine/ic_success.png" v-if="type == 1"></image>
		<image class="icon" src="../../static/mine/ic_failed.png" v-if="type == 2"></image>
		
		<text class="font-333-36 font-weight-600 mb-20">{{type == 1 ? '提交成功' : '提交失败'}}</text>
		<text class="font-999-28">{{type == 1 ? '感谢您提供的宝贵意见，我们会尽快与您联系！' : msg}}</text>
	
		<text class="back-btn" @click="goBackIndex">返回首页</text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type:1,  // 1成功 2失败
				msg:'' , //失败原因
			}
		},
		
		onLoad(options) {
			if (options.type){
				this.type = options.type
			}
			if (options.msg){
				this.msg = options.msg
			}
		},
		
		methods: {
			goBackIndex(){
				uni.switchTab({
					url:'/pages/mine/index'
				})
			}
		}
	}
</script>

<style lang="scss">
	.icon{
		width: 124rpx;
		height: 124rpx;
		margin-top: 190rpx;
		margin-bottom: 50rpx;
	}
	
	.back-btn{
		width: 424rpx;
		height: 88rpx;
		background: #F94C4B;
		border-radius: 10rpx;
		text-align: center;
		line-height: 88rpx;
		color: white;
		font-size: 32rpx;
		font-weight: 600;
		margin-top: 414rpx;
	}
</style>
